---
layout: none
---
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Raster test</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link rel="stylesheet" href="res/base.css">
  <style>

body > grid {
  grid-column-gap: var(--spacingv);
  grid-row-gap: var(--spacingv);
  margin-bottom: calc(var(--spacingv) * 4);
}
c {
  padding: 1rem;
}

  </style>
</head>
<body>

  <grid columns="8" class="debug">

    <c span="1">1</c>
    <c span="1">2</c>
    <c span="1">3</c>
    <c span="1">4</c>
    <c>5</c>
    <c>6</c>
    <c>7</c>
    <c>8</c>

    <c span="1">1</c>
    <c span="3">3</c>
    <c span="1">1</c>
    <c span="3">3</c>

    <c span="2+2">2+2</c>
    <c span="5-8">5-8</c>

    <c span="2" span-s="row">2</c>

    <c span="1..">1..</c>
    <c span="2..">2..</c>
    <c span="4..">4..</c>
    <c span="4-20">4-20</c>
    <c span="4+3">4+3</c>

    <c span="row">row</c>
    <c span="8">8</c>

    <c span="invalid">invalid</c>
    <c span="9-3">9-3 (invalid)</c>

  </grid>

<pre id="css-output"></pre>
<script src="res/generate-grid.js"></script>
<script>
let css = Raster.generateCSS({
  minColumns: 1,
  maxColumns: 8,
  defaultColumns: 4,
})

let style = document.createElement('style')
document.head.appendChild(style)
style.appendChild(document.createTextNode(css))

let outel = document.querySelector('#css-output')
outel.appendChild(document.createTextNode(css))
</script>

</body>
</html>
